﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FoodManager
{
    public partial class Login : Form
    {
        public event EventHandler LoginEvent;
        public Login()
        {
            InitializeComponent();
           
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (Program.CurrentUser.Login(txtUsername.Text, txtPassword.Text))
            {

                if (LoginEvent != null)
                {
                    LoginEvent(sender, e);
                }
                this.Close();
            }
            else
            {
                MessageBox.Show("Bạn nhập sai username hoặc password");
            }
        }

    }
}
